<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <link rel="stylesheet" th:href="@{/code/css/reset.css}">
    <link rel="stylesheet" th:href="@{/code/css/reg.css}">
    <script th:src ="@{/code/js/jquery-3.4.1.js}"></script>
</head>

<body>
<script type="text/javascript">
    function a() {
        $.ajax({
            url:"/user/setemail",
            data:{"email":$(email).val()},
            success:function (data) {
                console.log(data)
            }
        });
    }
</script>


    <div class="banner">
        <img th:src="@{/code/img/banner.png}" alt="">
        <div class="color"></div>
    </div>
    <div class="form">
        <h2>
            <span>注册</span>
        </h2>
        <div class="form-area">
            <form action="/user/adduser" method="post">
            <div class="form-item ">
                <input type="text" name="name" placeholder="昵称">
                <div class="error">该名字已被他人使用</div>
            </div>
            <div class="form-item">
                <input type="password" name="password" placeholder="密码（6-16个字符组成，区分大小写）">
            </div>
            <div class="form-item clearfix">
                <div class="select">
                    <div class="select-item">
                        <title>中国大陆</title>

                    </div>
                    <div class="input">
                        <input type="text" id="email" name="email" placeholder="填写常用邮箱地址">
                    </div>
                </div>
            </div>

            <div class="form-item get">
                <input type="text" name="code" placeholder="请输入邮箱验证码">
                <button  type="button" onclick="a()">点击获取</button>
<!--                <a th:href="@{/user/setemail/}+${email}">获取</a>-->
            </div>

            <div class="form-item">
                <!-- disabled是一个伪类 -->
                <button class="reg"  type="submit">注册</button>
            </div>
            </form>
            <div class="tip-content clearfix"></div>
                <div class="tip clearfix">
                    <a th:href="@{/touser/login}">已有账号，直接登录&gt;</a>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
